﻿using YNTK.Dependency;
using YNTK.DynamicApiController;
using YNTK.System.Interfaces.Common;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Minio;
using System.Threading.Tasks;

namespace YNTK.System.Service.Common
{
    /// <summary>
    /// 测试接口
    /// </summary>
    [ApiDescriptionSettings(Name = "Test", Order = 306)]
    [Route("api/[controller]")]
    public class TestService : IDynamicApiController, ITransient
    {
        private readonly IFileService fileService;
        public TestService(IFileService _fileService)
        {
            fileService = _fileService;
        }

        //[HttpGet("")]
        //[AllowAnonymous]
        //public async Task<dynamic> test1()
        //{
        //    SmsUtil.SendSmsByTencent("AKIDWrvjGWWGiupUs0rSmpa5IEtHOEn56rLY", "zjCOJxKQEm33mE2ZpsfAPN5VeW7RUFky", "ap-guangzhou", new string[] { "+8618270829367" }, "1400512125", "932035");
        //    SmsUtil.SendSmsByAli("18270829367", "阿里云-已审批", "SMS_218026777",
        //       "79gckw3uhaffc2idpjnbjk1w", "NxbvE3/KTkT25A9xAGCGPRHO7mk=");

        //    var minIo = new MinioClient("192.168.0.60:9000", "minioadmin", "minioadmin");
        //    var list = await minIo.ListBucketsAsync();
        //    FileStreamResult dd = null;
        //    await minIo.GetObjectAsync("YNTKsoftoss", "useravatar/20210824_26e4b7274a09400fb5c06cbf46cc89c1.png",
        //        (stream) =>
        //        {
        //            //stream.CopyTo(Console.OpenStandardOutput());
        //            dd = new FileStreamResult(stream, "application/octet-stream") { FileDownloadName = "20210824_26e4b7274a09400fb5c06cbf46cc89c1.png" };
        //        });
        //    return dd;
        //    return new { handleId = "1adea3ff-8a25-420b-a628-c5cb78fd,1d291dca90bb4858b26f0bc04" };
        //    return fileService.MinioDownloadFile();
        //}
    }
}
